package com.lagou.edu.service.impl;

import com.lagou.edu.mapper.TbResumeMapper;
import com.lagou.edu.pojo.TbResume;
import com.lagou.edu.service.TbResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Optional;

@Service
@Transactional
public class TbResumeServiceImpl implements TbResumeService {

    @Autowired
    private TbResumeMapper tbResumeMapper;

    @Override
    public List<TbResume> findAll(){
        return tbResumeMapper.findAll();
    }

    @Override
    public Optional<TbResume> findById(Long id) {
        return tbResumeMapper.findById(id);
    }

    @Override
    public TbResume saveOrUpdateResume(TbResume resume) {
        return tbResumeMapper.save(resume);
    }

    @Override
    public void deleteResume(TbResume resume) {
        tbResumeMapper.delete(resume);
    }
}
